package com.lei.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lei.entity.UserEntity;
import com.lei.service.UserService;
import com.lei.service.impl.UserServiceImpl;

public class UserServlet extends HttpServlet {
	static UserService userService = new UserServiceImpl();
	List<UserEntity> list = new ArrayList<UserEntity>();

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		String userName = req.getParameter("userName");
		String passWord = req.getParameter("passWord");
		for (UserEntity user : list) {
			if (user.equals(userName) && user.equals(passWord)) {
				req.getAttribute("用户名密码输入正确");
			} else {
				req.getAttribute("用户名密码输入错误");
			}
		}

	}

}
